package com.kuang.dao.bill;

import com.kuang.pojo.Bill;
import com.kuang.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class BillDaoImpl implements BillDao{

    @Override
    public List<Bill> getBillList() {
        try {
            Class.forName("com.mysql.jdbc.Driver");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        //第一步：获得SqlSession对象
        SqlSession sqlSession = MybatisUtil.getSqlSession();
        BillDao bill = sqlSession.getMapper(BillDao.class);
        List<Bill> list  = bill.getBillList();
        return list;
    }
}
